package tmproject.hlhj.fhp.anwser.utils

import android.content.Context

/**
 * Created by Never Fear   on 2018\8\21 0021.
Never More....
 */
object SPHelper {
    val TOKEN_KEY="tokenkey"

    fun saveToken(context: Context,token:String){
        val sp = context.getSharedPreferences(TOKEN_KEY, Context.MODE_PRIVATE)
        val edit = sp.edit()
        edit.putString("token",token)
        edit.apply()
    }

    fun getToken(context: Context): String? {
        val sp = context.getSharedPreferences(TOKEN_KEY, Context.MODE_PRIVATE)
        return sp.getString("token","")
    }
}